local HurtStrategy = require("gameLogic.fight.fightHurtStrategy.HurtStrategy")
local HurtTreatment = class("HurtTreatment", HurtStrategy)
local Hurt = require("gameLogic.fight.fightHurtStrategy.Hurt")

function HurtTreatment:ctor(config, skill)
    HurtTreatment.super.ctor(self, config, skill)
end

function HurtTreatment:hurt(target)
    local AttributeConst = require("const.AttributeConst")
    local ratio = self._config.ratio
    local entity = self._skill:getEntity()
    local attrValue = entity:getAttrValue(AttributeConst.ATTACK) * ratio
    local finalHurt, isCrit = self:_critHurt(attrValue)
    finalHurt = math.floor(finalHurt)
    local hurt = Hurt.new(finalHurt, isCrit, AttributeConst.ELEMENT_TREATMENT, false, entity)
    return hurt
end

return HurtTreatment
